package com.axiang.module_work.model;

import android.app.Application;

import com.axiang.lib_api.RetrofitManager;
import com.axiang.lib_api.http.RxAdapter;
import com.axiang.lib_api.response.BaseResponse;
import com.axiang.lib_common.mvvm.model.BaseModel;
import com.axiang.lib_common.network.ObserverUtil;
import com.axiang.module_work.api.IWorkApi;
import com.axiang.module_work.bean.HomeMessageBean;

import java.util.HashMap;
import java.util.List;

import io.reactivex.Observable;


public class WorkModel extends BaseModel {

    public WorkModel(Application application) {
        super(application);
    }

    public Observable<BaseResponse<HomeMessageBean>> getMessageList(int pageNo){
        IWorkApi iHomeApi = RetrofitManager.getInstance().create(IWorkApi.class);
        // 返回之前调用线程管理方法
        return iHomeApi.getPlayingMovie(pageNo, new HashMap<String, String>()).compose(ObserverUtil.<BaseResponse<HomeMessageBean>>schedulersTransformer(this));
    }

}
